package edu.pku.se.chocolate.datastructure;

/**
 * 
 * @author Zhiyou Liu
 * An data type to present the parsed XML response of
 * the "New Message Number" request. 
 */
public class MessageNumberResponse {
	/**
	 * `tag' is this query tag. 
	 */
	public Tag tag;
	public int newMessageNumber;
	public int newestID;
	public String returnTag;
	/**
	 * Generate a new instance that same
	 * as the origin one. PLZ note that `tag'
	 * will not be copied. new instance and 
	 * the origin one share with the same tag.
	 * When MessageFetcher use it, there will 
	 * be not problem since it will assign 
	 * `tag' to proper one before it calls 
	 * this method.
	 * @return the new instance
	 */
	public MessageNumberResponse copy() {
		MessageNumberResponse instance = new MessageNumberResponse();
		instance.tag = tag;
		instance.newestID = newestID;
		instance.newMessageNumber = newMessageNumber;
		instance.returnTag = returnTag;
		return instance;
	}
	
	public String toString() {
		return "+ returnTag: "+ returnTag + "\n" +
		       "+ newestID: " + newestID + "\n" +
		       "+ newMessageNumber: " + newMessageNumber + "\n";
	}

}
